-
-
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.
- Loading branch information
Showing
14 changed files
with
127 additions
and
187 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 |
---|---|---|
@@ -1,5 +1,7 @@ | ||
# Changelog | ||
|
||
## 1.13.2 release | ||
|
||
## [Fix] 07.28.2021 - 1 | ||
* Fixed issues with server sided translation keys | ||
|
||
|
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,28 +1,15 @@ | ||
package eu.gir.gircredstone; | ||
|
||
import org.apache.logging.log4j.LogManager; | ||
import org.apache.logging.log4j.Logger; | ||
|
||
import eu.gir.gircredstone.proxy.CommonProxy; | ||
import net.minecraftforge.fml.common.Mod; | ||
import net.minecraftforge.fml.common.Mod.EventHandler; | ||
import net.minecraftforge.fml.common.SidedProxy; | ||
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; | ||
|
||
@Mod(modid = GIRCRedstoneMain.MODID) | ||
public class GIRCRedstoneMain | ||
{ | ||
public static final String MODID = "gircredstone"; | ||
@Mod(GIRCRedstoneMain.MODID) | ||
public class GIRCRedstoneMain { | ||
|
||
public static Logger logger; | ||
public static final Logger LOGGER = LogManager.getLogger(); | ||
|
||
@SidedProxy(serverSide = "eu.gir.gircredstone.proxy.CommonProxy", clientSide = "eu.gir.gircredstone.proxy.ClientProxy") | ||
public static CommonProxy PROXY; | ||
|
||
@EventHandler | ||
public void preInit(FMLPreInitializationEvent event) | ||
{ | ||
logger = event.getModLog(); | ||
PROXY.preinit(); | ||
} | ||
public static final String MODID = "gircredstone"; | ||
|
||
} |
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
46 changes: 18 additions & 28 deletions
46
src/main/java/eu/gir/gircredstone/block/BlockRedstoneAcceptor.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 |
---|---|---|
@@ -1,50 +1,40 @@ | ||
package eu.gir.gircredstone.block; | ||
|
||
import net.minecraft.block.properties.IProperty; | ||
import net.minecraft.block.properties.PropertyBool; | ||
import net.minecraft.block.state.BlockStateContainer; | ||
import net.minecraft.block.Block; | ||
import net.minecraft.block.state.IBlockState; | ||
import net.minecraft.state.BooleanProperty; | ||
import net.minecraft.state.StateContainer.Builder; | ||
import net.minecraft.util.EnumFacing; | ||
import net.minecraft.util.math.BlockPos; | ||
import net.minecraft.world.IBlockAccess; | ||
import net.minecraft.world.IBlockReader; | ||
|
||
public class BlockRedstoneAcceptor extends BlockBasic { | ||
|
||
public static final PropertyBool POWER = PropertyBool.create("power"); | ||
public static final BooleanProperty POWER = BooleanProperty.create("power"); | ||
|
||
public BlockRedstoneAcceptor() { | ||
super("acceptor"); | ||
this.setDefaultState(getDefaultState().withProperty(POWER, false)); | ||
this.setDefaultState(getDefaultState().with(POWER, false)); | ||
} | ||
|
||
@Override | ||
public int getMetaFromState(IBlockState state) { | ||
return state.getValue(POWER) ? 0:1; | ||
public boolean canProvidePower(IBlockState state) { | ||
return true; | ||
} | ||
|
||
@Override | ||
public boolean canProvidePower(IBlockState state) { | ||
return true; | ||
public int getWeakPower(IBlockState blockState, IBlockReader blockAccess, BlockPos pos, EnumFacing side) { | ||
return this.getStrongPower(blockState, blockAccess, pos, side); | ||
} | ||
|
||
public int getWeakPower(IBlockState blockState, IBlockAccess blockAccess, BlockPos pos, EnumFacing side) | ||
{ | ||
return getStrongPower(blockState, blockAccess, pos, side); | ||
@Override | ||
public int getStrongPower(IBlockState blockState, IBlockReader blockAccess, BlockPos pos, EnumFacing side) { | ||
return blockState.get(POWER) ? 15:0; | ||
} | ||
|
||
public int getStrongPower(IBlockState blockState, IBlockAccess blockAccess, BlockPos pos, EnumFacing side) | ||
{ | ||
return blockState.getValue(POWER) ? 15:0; | ||
@Override | ||
protected void fillStateContainer(Builder<Block, IBlockState> builder) { | ||
builder.add(POWER); | ||
} | ||
|
||
@Override | ||
public IBlockState getStateFromMeta(int meta) { | ||
return this.getDefaultState().withProperty(POWER, meta == 1); | ||
} | ||
|
||
@Override | ||
protected BlockStateContainer createBlockState() { | ||
return new BlockStateContainer(this, new IProperty[] { POWER }); | ||
} | ||
|
||
|
||
} |
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,36 +1,54 @@ | ||
package eu.gir.gircredstone.init; | ||
|
||
import eu.gir.gircredstone.GIRCRedstoneMain; | ||
import eu.gir.gircredstone.block.BlockRedstoneAcceptor; | ||
import eu.gir.gircredstone.block.BlockRedstoneEmitter; | ||
import eu.gir.gircredstone.item.Linkingtool; | ||
import eu.gir.gircredstone.tile.TileRedstoneEmitter; | ||
import net.minecraft.block.Block; | ||
import net.minecraft.item.Item; | ||
import net.minecraft.item.Item.Properties; | ||
import net.minecraft.item.ItemBlock; | ||
import net.minecraft.item.ItemGroup; | ||
import net.minecraft.tileentity.TileEntityType; | ||
import net.minecraftforge.event.RegistryEvent; | ||
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; | ||
import net.minecraftforge.eventbus.api.SubscribeEvent; | ||
import net.minecraftforge.fml.common.Mod; | ||
import net.minecraftforge.fml.common.Mod.EventBusSubscriber.Bus; | ||
import net.minecraftforge.registries.IForgeRegistry; | ||
|
||
@Mod.EventBusSubscriber(bus=Bus.MOD, modid = GIRCRedstoneMain.MODID) | ||
public class GIRCInit { | ||
|
||
public static final Block RS_ACCEPTOR = new BlockRedstoneAcceptor(); | ||
public static final Block RS_EMITTER = new BlockRedstoneEmitter(); | ||
|
||
public static final Item RS_LINKER = new Linkingtool(); | ||
|
||
@SubscribeEvent | ||
public static void registerBlock(RegistryEvent.Register<Block> event) { | ||
IForgeRegistry<Block> registry = event.getRegistry(); | ||
registry.register(RS_ACCEPTOR); | ||
registry.register(RS_EMITTER); | ||
GIRCRedstoneMain.LOGGER.info("Hello!000000000000=========================================000000"); | ||
} | ||
|
||
@SubscribeEvent | ||
public static void registerItem(RegistryEvent.Register<Item> event) { | ||
IForgeRegistry<Item> registry = event.getRegistry(); | ||
registry.register(new ItemBlock(RS_ACCEPTOR).setRegistryName(RS_ACCEPTOR.getRegistryName())); | ||
registry.register(new ItemBlock(RS_ACCEPTOR, new Properties().group(ItemGroup.REDSTONE)) | ||
.setRegistryName(RS_ACCEPTOR.getRegistryName())); | ||
registry.register(RS_LINKER); | ||
registry.register(new ItemBlock(RS_EMITTER).setRegistryName(RS_EMITTER.getRegistryName())); | ||
registry.register(new ItemBlock(RS_EMITTER, new Properties().group(ItemGroup.REDSTONE)) | ||
.setRegistryName(RS_EMITTER.getRegistryName())); | ||
} | ||
|
||
public static final TileEntityType<?> EMITER_TILE = TileEntityType.Builder.create(TileRedstoneEmitter::new).build(null); | ||
|
||
@SubscribeEvent | ||
public static void registerTE(RegistryEvent.Register<TileEntityType<?>> evt) { | ||
EMITER_TILE.setRegistryName(GIRCRedstoneMain.MODID, "emitter"); | ||
evt.getRegistry().register(EMITER_TILE); | ||
} | ||
|
||
|
||
} |
Oops, something went wrong.