-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update to 1.20 and reintroduce powered light rods
- Loading branch information
Showing
31 changed files
with
689 additions
and
82 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,3 +31,10 @@ bin/ | |
# fabric | ||
|
||
run/ | ||
|
||
# java | ||
|
||
hs_err_*.log | ||
replay_*.log | ||
*.hprof | ||
*.jfr |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,21 @@ | ||
# Done to increase the memory available to gradle. | ||
org.gradle.jvmargs=-Xmx1G | ||
org.gradle.parallel=true | ||
|
||
# Fabric Properties | ||
# check these on https://fabricmc.net/versions.html | ||
minecraft_version=1.18 | ||
yarn_mappings=1.18+build.1 | ||
loader_version=0.12.6 | ||
# check these on https://fabricmc.net/develop | ||
minecraft_version=1.20.1 | ||
yarn_mappings=1.20.1+build.1 | ||
loader_version=0.14.21 | ||
|
||
# Mod Properties | ||
mod_version = 7.2+1.18 | ||
maven_group = re.domi | ||
archives_base_name = invisiblights-fabric | ||
mod_version=7.3+1.20 | ||
maven_group=re.domi | ||
archives_base_name=invisiblights | ||
|
||
# Dependencies | ||
fabric_version=0.43.1+1.18 | ||
fabric_version=0.83.0+1.20.1 | ||
|
||
mod_menu_version=7.1.0 | ||
reborn_energy_version=3.0.0 | ||
tech_reborn_version=5.8.3 |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3-bin.zip | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-bin.zip | ||
networkTimeout=10000 | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,4 +7,4 @@ pluginManagement { | |
mavenCentral() | ||
gradlePluginPortal() | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,45 @@ | ||
package re.domi.invisiblights; | ||
|
||
import net.fabricmc.api.ModInitializer; | ||
import net.fabricmc.fabric.api.itemgroup.v1.ItemGroupEvents; | ||
import net.minecraft.block.Block; | ||
import net.minecraft.item.Item; | ||
import net.minecraft.item.ItemGroups; | ||
import net.minecraft.item.ItemStack; | ||
import net.minecraft.registry.Registries; | ||
import net.minecraft.registry.Registry; | ||
import net.minecraft.state.property.BooleanProperty; | ||
import net.minecraft.util.Identifier; | ||
import net.minecraft.util.registry.Registry; | ||
import re.domi.invisiblights.config.Config; | ||
|
||
@SuppressWarnings("WeakerAccess") | ||
public class InvisibLights implements ModInitializer | ||
{ | ||
public static final int GLOWSTONE_COST = 2; | ||
public static BooleanProperty FROM_POWERED_ROD = BooleanProperty.of("from_powered_rod"); | ||
|
||
public static Item LightRod; | ||
public static PoweredLightRodItem PoweredLightRod; | ||
public static Block LightSource; | ||
|
||
@Override | ||
public void onInitialize() | ||
{ | ||
LightRod = Registry.register(Registry.ITEM, new Identifier("invisiblights", "light_rod"), new LightRodItem()); | ||
Config.read(); | ||
|
||
LightRod = Registry.register(Registries.ITEM, new Identifier("invisiblights", "light_rod"), new LightRodItem()); | ||
PoweredLightRod = Registry.register(Registries.ITEM, new Identifier("invisiblights", "powered_light_rod"), new PoweredLightRodItem()); | ||
|
||
LightSource = Registry.register(Registries.BLOCK, new Identifier("invisiblights", "light_source"), new LightSourceBlock()); | ||
|
||
ItemGroupEvents.modifyEntriesEvent(ItemGroups.TOOLS).register(entries -> | ||
{ | ||
entries.add(new ItemStack(LightRod)); | ||
entries.add(new ItemStack(PoweredLightRod)); | ||
|
||
ItemStack fullyCharged = new ItemStack(PoweredLightRod); | ||
PoweredLightRod.setStoredEnergy(fullyCharged, PoweredLightRod.getEnergyCapacity(fullyCharged)); | ||
|
||
entries.add(fullyCharged); | ||
}); | ||
} | ||
} |
16 changes: 16 additions & 0 deletions
16
src/main/java/re/domi/invisiblights/InvisibLightsClient.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package re.domi.invisiblights; | ||
|
||
import net.fabricmc.api.ClientModInitializer; | ||
import net.fabricmc.fabric.api.blockrenderlayer.v1.BlockRenderLayerMap; | ||
import net.minecraft.client.render.RenderLayer; | ||
|
||
public class InvisibLightsClient implements ClientModInitializer | ||
{ | ||
public static boolean LightSourcesHidden = true; | ||
|
||
@Override | ||
public void onInitializeClient() | ||
{ | ||
BlockRenderLayerMap.INSTANCE.putBlock(InvisibLights.LightSource, RenderLayer.getTranslucent()); | ||
} | ||
} |
Oops, something went wrong.