-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
broken commit for review and testing, ducking doesnt work
- Loading branch information
Showing
16 changed files
with
245 additions
and
98 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
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
40 changes: 23 additions & 17 deletions
40
src/main/java/pkg/deepCurse/pandora/core/items/PandoraDebugStickItem.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
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
67 changes: 67 additions & 0 deletions
67
src/main/java/pkg/deepCurse/pandora/core/mixins/shared/PlayerEntityMixin.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,67 @@ | ||
package pkg.deepCurse.pandora.core.mixins.shared; | ||
|
||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
import org.spongepowered.asm.mixin.injection.Inject; | ||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; | ||
|
||
import com.mojang.authlib.GameProfile; | ||
|
||
import net.minecraft.entity.player.PlayerEntity; | ||
import net.minecraft.nbt.NbtCompound; | ||
import net.minecraft.nbt.NbtElement; | ||
import net.minecraft.network.encryption.PlayerPublicKey; | ||
import net.minecraft.util.math.BlockPos; | ||
import net.minecraft.world.World; | ||
import pkg.deepCurse.pandora.core.util.interfaces.PlayerGrueDataInterface; | ||
|
||
//import net.minecraft.nbt.NbtCompound; | ||
//import net.minecraft.world.PersistentState; | ||
|
||
@Mixin(PlayerEntity.class) | ||
public abstract class PlayerEntityMixin extends PlayerEntity implements PlayerGrueDataInterface { | ||
public PlayerEntityMixin(World world, BlockPos pos, float yaw, GameProfile gameProfile, PlayerPublicKey publicKey) { | ||
super(world, pos, yaw, gameProfile, publicKey); | ||
} | ||
|
||
private long lastEncounterTime; // PandoraGrueLastEncounterTime | ||
private short trainingWheelEncountersLeft; // PandoraGrueTrainingWheelEncountersLeft | ||
|
||
@Override | ||
public short getTrainingWheelEncountersLeft() { | ||
return trainingWheelEncountersLeft; | ||
} | ||
|
||
@Override | ||
public void setTrainingWheelEncountersLeft(short trainingWheelEncountersLeft) { | ||
this.trainingWheelEncountersLeft = trainingWheelEncountersLeft; | ||
} | ||
|
||
@Override | ||
public long getLastEncounterTime() { | ||
return lastEncounterTime; | ||
} | ||
|
||
@Override | ||
public void setLastEncounterTime(long lastEncounterTime) { | ||
this.lastEncounterTime = lastEncounterTime; | ||
} | ||
|
||
@Inject(method = "readCustomDataFromNbt", at = @At(value = "RETURN")) | ||
public void pandora_readCustomDataFromNbt(NbtCompound nbt, CallbackInfo ci) { | ||
this.trainingWheelEncountersLeft = nbt.contains("PandoraGrueTrainingWheelEncountersLeft", NbtElement.SHORT_TYPE) | ||
? 7 | ||
/* TODO config this */ : nbt.getShort("PandoraGrueTrainingWheelEncountersLeft"); | ||
this.lastEncounterTime = nbt.contains("PandoraGrueLastEncounterTime", NbtElement.LONG_TYPE) ? 0 | ||
/* TODO config this */ : nbt.getLong("PandoraGrueLastEncounterTime"); | ||
} | ||
|
||
@Inject(method = "writeCustomDataToNbt", at = @At(value = "RETURN")) | ||
public void pandora_writeCustomDataToNbt(NbtCompound nbt, CallbackInfo ci) { | ||
nbt.putShort("PandoraGrueTrainingWheelEncountersLeft", trainingWheelEncountersLeft); | ||
nbt.putLong("PandoraGrueLastEncounterTime", lastEncounterTime); | ||
} | ||
} | ||
/* | ||
* | ||
*/ |
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
11 changes: 11 additions & 0 deletions
11
src/main/java/pkg/deepCurse/pandora/core/util/interfaces/PlayerGrueDataInterface.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,11 @@ | ||
package pkg.deepCurse.pandora.core.util.interfaces; | ||
|
||
public interface PlayerGrueDataInterface { | ||
short getTrainingWheelEncountersLeft(); | ||
|
||
void setTrainingWheelEncountersLeft(short trainingWheelEncountersLeft); | ||
|
||
long getLastEncounterTime(); | ||
|
||
void setLastEncounterTime(long lastEncounterTime); | ||
} |
Oops, something went wrong.
9e62c57
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ducking in the commit name is not meant to be crass, its referring to duck interfaces